package com.xckj.zuoliao.framework.net;

import androidx.annotation.NonNull;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * @Author: 代码的搬运工
 * @Describe: 头部拦截器
 * @Date: 2024/3/27 23:36
 */
public class HeadIntercept implements Interceptor {
    @NonNull
    @Override
    public Response intercept(@NonNull Chain chain) throws IOException {
        Request oldRequest = chain.request();
        Request newRequest = oldRequest.newBuilder()
                .addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")
                .addHeader("Accept", "*/*").build();
        return chain.proceed(newRequest);
    }
}
